<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class UserPersonnel extends Model
{
    protected $guarded = [];

    //用户关联
    public function user()
    {
        return $this->belongsTo('App\User', 'user_id');
    }

    public function flaunt()
    {
        return $this->belongsTo('App\Flaunt','user_id','user_id');
    }

    //基本信息
    public function basic()
    {
        return $this->belongsTo('App\Basic', 'user_id', 'uid');
    }

    //工作经验
    public function work()
    {
        return $this->hasMany('App\Work', 'pid');
    }

    //工作经验段数统计
    public function workNumber()
    {
        return $this->hasMany('App\Work', 'pid');
    }

    //教育背景
    public function education()
    {
        return $this->hasMany('App\Education', 'pid');
    }

    //工作意向
    public function intention()
    {
        return $this->hasOne('App\Intention', 'pid');
    }

    //语言能力
    public function language()
    {
        return $this->hasOne('App\Language', 'pid');
    }

    //项目经验
    public function project()
    {
        return $this->hasMany('App\Project', 'pid');
    }

    //公司信息
    public function companyInfo()
    {
        return $this->belongsTo('App\CompanyInfo', 'user_id', 'uid');
    }

    //发布的职位
    public function position()
    {
        return $this->hasMany('App\Position', 'uid', 'user_id');
    }
}
